﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using HA.ModFlow.Domain.DomainLayer;
using System.Windows.Controls;


namespace HA.ModFlow.Application
{
   public class TopElevationMFViewModel:MDTVIViewModel
    {

       public TopElevationMFViewModel(MDTVIViewModel parent, GridData grid):base(parent,false)
       {

           this._contextMenu = new ContextMenu();

           MenuItem mi = new MenuItem();

           mi.Header = "属性";

           mi.Command = ModflowV2Commands.EditTopElevation;

           this._contextMenu.Items.Add(mi);




           this._imageSource = VMImageSource.dataset;


           this._isShowCheck = false;





           this._gridData = grid;
 

       }


       GridData _gridData;


       public override string Desc
       {
           get
           {
               return "顶部高程";
           }
       }

       public override System.Windows.Input.ICommand DoubleClickCommand
       {
           get
           {
               return ModflowV2Commands.EditTopElevation;
           }
       }


       protected override void OnSelectedChanged()
       {

           if (this.IsSelected)
           {
               if (ProjectService.DefaultService.Project.CurentFlowVectorData != null)
               {
                   ProjectService.DefaultService.Project.CurentFlowVectorData = null;
               }
               if (ProjectService.DefaultService.Project.CurrentDSGrid != null)
               {
                   ProjectService.DefaultService.Project.CurrentDSGrid = null;
               }
               ProjectService.DefaultService.Project.CurrentDSData = this._gridData.GetTopElevationDs ();
               UIModule.DefaultModule.RibbonV2ViewModel.ViewOpViewModel.ToolVM.CurrentTool = APPTOOLMODE.GRID3D;
           }


       }


    }
}
